package com.paradigmcreatives.game.timers;

import java.util.Timer;
import java.util.TimerTask;

import android.util.Log;

import com.paradigmcreatives.game.manager.UIManager;
import com.paradigmcreatives.game.prefs.Preferences;

public class DoodleTimer extends TimerTask{

	private static final String TAG = "DoodleTimer";

	UIManager uiManager;
	
	int currentTime = 0;
	
	int intervalStep = 0;
	
	public DoodleTimer(UIManager uiManager,int intervalStep){
		this.uiManager = uiManager;
		this.intervalStep = intervalStep;
	}
	
	@Override
	public void run() {
		currentTime += intervalStep;
		Log.i(TAG, "CurrentTime is " + currentTime);
		if(currentTime >= Preferences.doodleDrawTime){
			uiManager.drawingTimeUp();
			this.cancel();
		}
		
	}

}
